//回到顶部
var id;
function returnTop() {
	id = setInterval('goTop()', 10);
}

function goTop() {
	scrollBy(0, -50);
	
	var scrollTop = document.documentElement.scrollTop + document.body.scrollTop;
	
	if (scrollTop == 0) {
		clearInterval(id);
	}
}
	
//滚动到一定距离出现returnTop	
window.onscroll = function(){
	var scrollTop = document.documentElement.scrollTop + document.body.scrollTop;
	
	var TopBar = document.getElementById('fixed-bar');
	
	if(scrollTop >= 150){
		TopBar.style.display = 'block';
	}else{
		TopBar.style.display = 'none';
	}
}


var lagouWeibo = document.getElementById('lagou-weibo');
var weibo = document.getElementById('weibo');
var lagouWeixin = document.getElementById('lagou-weixin');
var weixin = document.getElementById('weixin');

lagouWeibo.onmouseover = function(){
	weibo.style.display = 'block';
}

weibo.onmouseover = function(){
	weibo.style.display = 'block';
}

weibo.onmouseout = function(){
	weibo.style.display = 'none';
}

lagouWeibo.onmouseout = function(){
	weibo.style.display = 'none';
}

lagouWeixin.onmouseover = function(){
	weixin.style.display = 'block';
}

lagouWeixin.onmouseout = function(){
	weixin.style.display = 'none';
}


weixin.onmouseover = function(){
	weixin.style.display = 'block';
}

weixin.onmouseout = function(){
	weixin.style.display = 'none';
}
function checkPhone(obj){
	var phone = obj.value;
    var id = obj.id;
	var checkReg=/^0?1[3|5|7|8][0-9]{9}$/;
	if(!(checkReg.test(phone))){
		$("#" + id ).next().html("请输入正确的电话号码");
		$("#" + id ).next().css("color","red");			
		$("#" + id ).focus();
		document.getElementById("zlsubmit").disabled=true;
		/*$("#zlsubmit")[0].disabled=true;*/
	}else{
		$("#" + id ).next().html("正确");
		$("#" + id ).next().css("color","green");
		$("#zlsubmit")[0].disabled= false;
	}
}
function checkUserName(obj){
	var name = obj.value;
    var id = obj.id;
   /* /^[A-Za-z0-9]{6,18}$/   [\u4e00-\u9fa5a-zA-Z]{4,10}*/
	var checkName=/^[\u4e00-\u9fa5a-zA-Z0-9]{1,10}$/ ;
	if(checkName.exec(name)&&name !==null){
		$("#" + id ).next().html("合法");
		$("#" + id ).next().css("color","green");			
		document.getElementById("zlsubmit").disabled=false;
		
	}else{
		$("#" + id ).next().html("您的输入不合法，请中文名或者英文名，长度小于10");
		$("#" + id ).next().css("color","red");
		$("#" + id ).focus();
		$("#zlsubmit")[0].disabled= true;
	}
	
}
